package net.vinote.smart.platform.module.database;

import net.vinote.smart.platform.base.Platform;
import net.vinote.smart.platform.comm.PlatformConst;
import net.vinote.smart.platform.module.database.customize.MySQL;
import net.vinote.smart.platform.module.database.customize.Oracle;

public class DataBaseFeatureImp
{
    private static DataBaseFeature feature;
    
    private DataBaseFeatureImp()
    {
    }
    
    public static DataBaseFeature getInstance()
    {
        if (feature == null)
        {
            synchronized ("")
            {
                if (feature == null)
                {
                    String dbType = Platform.getAttribute(PlatformConst.SYSTEM_CFG_DATABASE_NAME);
                    if (PlatformConst.MYSQL.equalsIgnoreCase(dbType))
                    {
                        feature = new MySQL();
                    }
                    if (PlatformConst.ORACLE.equals(dbType))
                    {
                        feature = new Oracle();
                    }
                }
            }
        }
        return feature;
    }
    
}
